﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="addUser.aspx.cs" Inherits="admin_addUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><div class="Body_Title">
    系统信息管理 》》添加新用户</div>
<table class="style1">
    <tr>
        <td width="240px">
            用户登录名：</td>
        <td width="360px">
            <asp:TextBox ID="tbxLoginName" runat="server"></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="tbxLoginName" Display="Dynamic" ErrorMessage="登录名不可为空" 
                ValidationGroup="adduser"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            用户姓名：</td>
        <td>
            <asp:TextBox ID="tbxName" runat="server"></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="tbxName" Display="Dynamic" ErrorMessage="姓名不可为空" 
                ValidationGroup="adduser"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            密码：</td>
        <td>
            <asp:TextBox ID="tbxPassword" runat="server" TextMode="Password"></asp:TextBox>
        </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="tbxPassword" Display="Dynamic" ErrorMessage="密码不可为空" 
                ValidationGroup="adduser"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            确认密码：</td>
        <td>
            <asp:TextBox ID="tbxPasswordAgain" runat="server" TextMode="Password"></asp:TextBox>
        </td>
        <td>
            <asp:CompareValidator ID="CompareValidator4" runat="server" 
                ControlToCompare="tbxPassword" ControlToValidate="tbxPasswordAgain" 
                Display="Dynamic" ErrorMessage="2次密码输入不一致" ValidationGroup="adduser"></asp:CompareValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                ControlToValidate="tbxPasswordAgain" Display="Dynamic" ErrorMessage="确认密码不可为空" 
                ValidationGroup="adduser"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            用户角色</td>
        <td>
            <asp:DropDownList ID="ddlClass" runat="server" 
                DataSourceID="SqlDataSourceuserClass" DataTextField="c_Name" 
                DataValueField="cID">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSourceuserClass" runat="server" 
                ConnectionString="<%$ ConnectionStrings:LabInfoManageSystemConnectionString %>" 
                InsertCommand="INSERT INTO userInfo(u_LoginName, u_Name, u_password, u_class) VALUES (@Param1, @Param2, @Param3, @Param4)" 
                
                SelectCommand="SELECT * FROM [classInfo] WHERE ([c_parentID] = @c_parentID)" 
                oninserting="SqlDataSourceuserClass_Inserting">
                <InsertParameters>
                    <asp:Parameter Name="Param1" />
                    <asp:Parameter Name="Param2" />
                    <asp:Parameter Name="Param3" />
                    <asp:Parameter Name="Param4" />
                </InsertParameters>
                <SelectParameters>
                    <asp:Parameter DefaultValue="1" Name="c_parentID" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            操作</td>
        <td>
            <asp:Button ID="btnAdd" runat="server" Text="添加" ValidationGroup="adduser" 
                onclick="btnAdd_Click" />
        </td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>

